<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <script src="js/swiper-4.2.6.min.js" type="text/javascript" charset="utf-8"></script>
    <link rel="stylesheet" type="text/css" href="css/swiper-4.2.6.min.css"/>
    <script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
    <script src="js/public.js" type="text/javascript" charset="utf-8"></script>
    <script src="js/font.js"></script>
    <link rel="stylesheet" href="css/base.css">
    <link rel="stylesheet" href="css/ui.css">
    <title></title>
    <!-- 个人中心 -->
    <style>
    </style>
</head>
<body>
<div class="scroll-content my" style="overflow:auto;background: #F5F5F5;">
    <div class="top-public">
        <span class="public-center">个人中心</span>        
    </div>
    <div id="userList" class="user-info">
        <!--<div class="user-img">-->
            <!--<img src="images/my-icon1.png" alt="">-->
        <!--</div>-->
        <!--<ul>-->
            <!--<li><span>杨洋</span></li>-->
            <!--<li>20180930</li>-->
            <!--<li>1101/02/03</li>-->
        <!--</ul>-->
    </div>
    <div class="function-list">
        <ul>
            <a href="my_integral.html">
                <li style="background:#fff url(images/my-icon1.png) no-repeat 4% center;background-size: 0.23rem 0.21rem;margin-bottom: 0.1rem;">我的积分</li>
            </a>
            <a href="orderManagement.html">
                <li style="background:#fff url(images/my-icon2.png) no-repeat 4% center;background-size: 0.19rem 0.23rem;">订单管理</li>
            </a>
            <a href="my_costcenter.html">
                <li style="background:#fff url(images/my-icon3.png) no-repeat 4% center;background-size: 0.23rem 0.23rem;">费用中心</li>
            </a>
            <a href="my_servicecenter.html">
                <li style="background:#fff url(images/my-icon4.png) no-repeat 4% center;background-size: 0.2rem 0.23rem;">服务中心</li>
            </a>
            <a href="publishDemand.html">
                <li style="background:#fff url(images/my-icon5.png) no-repeat 4% center;background-size: 0.19rem 0.23rem;margin-bottom: 0.1rem;">发布需求</li>
            </a>
            <a href="my_mm.html">
                <li style="background:#fff url(images/icon_mima@2x.png) no-repeat 4% center;background-size:0.22rem;">支付密码</li>
            </a>
            <a href="my_setup.html">
                <li style="background:#fff url(images/my-icon6.png) no-repeat 4% center;background-size: 0.21rem 0.23rem;">设置</li>
            </a>
        </ul>
    </div>
    <div class="tab-bar">
        <a href="index.html" class="tab-button">
            <span class="tab-button-icon icon-home"></span>
            <span class="tab-button-txt">首页</span>
        </a>
        <a href="javascript:;" class="tab-button kf">
            <span class="tab-button-icon icon-kf"></span>
            <span class="tab-button-txt">客服</span>
        </a>
        <a href="my.html" class="tab-button active">
            <span class="tab-button-icon icon-my"></span>
            <span class="tab-button-txt">我的</span>
        </a>
    </div>
    <div class="pop-up">
        <p>400-800-9360</p>
        <ul>
            <li onclick="qx()">取消</li>
            <li onclick="qd()">
                <a href="tel:4008009360">呼叫</a>
            </li>
            
        </ul>
    </div>
    <div class="opacity-gray"></div>
</div>
</body>
<script>
$('.public-left').click(function(){
    window.history.go(-1);
})
function xz(obj){
    $('.choice-btn').removeClass('active');
    $(obj).addClass('active').siblings().removeClass('active');
}
$('.kf').click(function(){
    $('.pop-up').css('display','block');
    $('.opacity-gray').css('display','block');
})
function qx(){
    $('.pop-up').css('display','none');
    $('.opacity-gray').css('display','none');
}
function qd(){
    $('.pop-up').css('display','none');
    $('.opacity-gray').css('display','none');
}
</script>

<script>
    $(function(){
        //验证是否登陆
        var user_id = sessionStorage.getItem('userId');
        if (user_id == null) {
            alert('请先登录！');
            window.location.href = 'login.html';
        }
        //获取用户的信息
        getUserLists();
    });
    function getUserLists() {
        var user_id = sessionStorage.getItem("userId"); //用户ID
        $.ajax({
            url: url() + 'api/users/user_details', //请求的url地址
            dataType: "JSON",   //返回格式为json
            async: true,//请求是否异步，默认为异步，这也是ajax重要特性
            type: "POST",   //请求方式
            data:{
                user_id:user_id,
            },
            success: function (data) {
                //请求成功时处理
                if(data.status==1){
                    // console.log(data.result);
                    var html1 = '';
                    var img = imgUrl() + data.result.head_pic;
                    html1 = `
                            <div class="user-img">
                                <img src="${img}" alt="">
                            </div>
                            <ul>
                            <li><span>${data.result.provincial_jane}</span></li>
                            <li>${data.result.reg_time}</li>
                            <li>${data.result.user_code}</li>
                            </ul>
                    `;
                    $('#userList').html(html1);
                } else {
                    alert(data.msg);
                }
            }
        });
    }
</script>



</html> 






